package com.thread.learn.customlock;

/**
 * 测试重入锁
 * @author feelj
 *
 */
public class ReentrantLock {
	
	MyLock lock=new MyLock();
	
	public void a() {
		lock.lock();
		System.out.println("a");
		b();
		lock.unlock();
	}
	
	public void b() {
		lock.lock();
		System.out.println("b");
		lock.unlock();
	}
	
	public static void main(String[] args) {
		ReentrantLock d=new ReentrantLock();
		
		new Thread(new Runnable() {
			@Override
			public void run() {
				d.a();
			}
		}).start();
		
	}

}
